import React, { useState } from 'react';
import { Layout, Menu, theme } from 'antd';
import {  useNavigate } from 'react-router-dom'
import image from '../../src/static/logo.jpg'
import { CarryOutOutlined, PieChartOutlined, MailOutlined, LockOutlined, SettingOutlined,FundOutlined,ChromeOutlined ,AppstoreOutlined} from '@ant-design/icons';
const { Sider } = Layout;
function getItem(label, key, icon, children) {
    return {
        key,
        icon,
        children,
        label,
    };
}
const items = [
    getItem('首页', '/Home', <PieChartOutlined />),
    getItem('访客记录', 'sub1', <MailOutlined />, [
        getItem('访客列表', '/Home/VisitorList'),
        getItem('访客添加修改', '/Home/VisitorAdd'),
        getItem('负责人操作导入详细', '4'),
    ]),
    getItem('部门管理', 'sub2', <FundOutlined />, [getItem('部门列表', '5'), getItem('部门添加修改', '6')]),
    getItem('管理员', 'sub3', <LockOutlined />, [getItem('管理员列表', '7'), getItem('管理员添加修改', '8')]),
    getItem('核销人员管理', 'sub4', <ChromeOutlined />, [getItem('核销人员列表', '9'), getItem('核销人员添加修改', '10'),getItem('核销人员日志', '11')]),
    getItem('审核日志', 'sub5', <CarryOutOutlined />, [getItem('审核列表', '12'),]),
    getItem('校园动态', 'sub6', <AppstoreOutlined />, [getItem('校园动态列表', '13'), getItem('校园动态添加修改', '14')]),
    getItem('设置', 'sub7', <SettingOutlined />)
];
const Siders = () => {
    const [collapsed, setCollapsed] = useState(false);
    const navigate = useNavigate()
    const {
        token: { colorBgContainer },
    } = theme.useToken();
    return (

        <Sider collapsible collapsed={collapsed} onCollapse={(value) => setCollapsed(value)}>
            <div
                style={{
                    height: 50,
                    margin: 16,
                    background: 'rgba(255, 255, 255, 0.2)',
                }}
            >
            <img src={image} alt="" />
            <Menu theme="dark" defaultSelectedKeys={['1']} mode="inline" items={items} onSelect={(e) => {
                navigate(e.keyPath[0])
            }} />
            </div>
        </Sider>

    )
}
export default Siders;